package com.example.taluo.service;

import com.example.taluo.entity.dto.gamedto.UserRanking;
import com.example.taluo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LeaderBoardService {
    @Autowired
    private UserMapper userMapper;

    // 带分页的排行榜查询
    public List<UserRanking> getLeaderboard(int page, int size) {
        List<UserRanking> list = userMapper.selectLeaderboard();
        return  list;
    }

    // 获取用户个人排名
    public UserRanking getUserRanking(int userId) {
        return userMapper.selectUserRanking(userId);
    }
}
